import { Controller, Get, Body, Param } from '@nestjs/common';
import { UsersService } from "@src/modules/users/users.service"
import { GetOneUserDTO } from '@src/dtos/users/getOneUser.dto'
import { ApiTags, ApiOperation, ApiParam } from '@nestjs/swagger';
@ApiTags('用户')
@Controller('users')
export class UsersController {
   constructor(
      public readonly usersService: UsersService
   ) {

   }

   @ApiOperation({
      summary: '获取单个用户',
      description: ''
    })
   @ApiParam({name: 'username' ,description: '用户名'}) 
   @Get(':username')
   async findOne(@Param() params: GetOneUserDTO) {
      let res = await this.usersService.findOne(params.username)
      return res
   }
}
